<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SqlDataSourceControlPage.aspx.cs" Inherits="SqlDataSourceControlPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Country:
        <asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True">
            <asp:ListItem>United State</asp:ListItem>
            <asp:ListItem>Vietnam</asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitVietnamDbConnectionString %>" SelectCommand="SELECT [UserID], [Company], [Address], [Country], [JobPosition], [FromMonthYear], [ToMonthYear], [Salary] FROM [tblJSExperiences] WHERE ([Country] = @Country)">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlCountry" DefaultValue="Vietnam" Name="Country"
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    </div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="UserID" HeaderText="UserID" SortExpression="UserID" />
                <asp:BoundField DataField="Company" HeaderText="Company" SortExpression="Company" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
                <asp:BoundField DataField="JobPosition" HeaderText="JobPosition" SortExpression="JobPosition" />
                <asp:BoundField DataField="FromMonthYear" HeaderText="FromMonthYear" SortExpression="FromMonthYear" />
                <asp:BoundField DataField="ToMonthYear" HeaderText="ToMonthYear" SortExpression="ToMonthYear" />
                <asp:BoundField DataField="Salary" HeaderText="Salary" SortExpression="Salary" />
            </Columns>
        </asp:GridView>
    </form>
</body>
</html>
